<gm:page title="Hello World">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example</title>
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAe3W--m4GtgYJBxqvPjt_BhS9z9yliITj3Gj9i40zG2r_kfJUbxRsPO63L12ykwjpsxI-hBz3wPOnPg"
      type="text/javascript"></script>
    <script type="text/javascript"> 
    //<![CDATA[
    function load() {
      if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
var center = new GLatLng(38,105);
var marker = new GMarker(center);
var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(38,105),4); 
GEvent.addListener(map, "click", function(marker, point) 
{ var lat_point;
  var lng_point; 
 if (marker) { 
map.removeOverlay(marker);lng_point=0;lat_point=0; }
 else 
{ map.clearOverlays();
var marker2=new GMarker(point);
map.addOverlay(marker2);
lat_point=point.lat();//纬度，放前面
lng_point=point.lng();//经度
marker2.openInfoWindowHtml("<b>中国科学院研究生院</b>"); } 
});

GEvent.addListener(map, "zoomend", function(oldlevel,newlevel)
 {var new1=map.getZoom();//得到当前的级别
});
map.addControl(new GSmallMapControl()); 
map.addControl(new GMapTypeControl());
map.addControl(new GScaleControl());
map.setCenter(center, 4); 
map.setMapType(G_HYBRID_TYPE);
      }
    }
    //]]>
    </script>
</head>
<body onload="load()" onunload="GUnload()">
<div id="map" style="width: 960px; height: 530px"></div>
</body>
</html>

</gm:page>
















































































































